from django.urls import path, re_path
from django.contrib.auth.decorators import login_required
from . import views

urlpatterns = [

    path('register', views.RegisterView.as_view(), name='register'),  # 注册
    re_path(r'^active/(?P<token>.*)$', views.ActiveView.as_view(), name='active'),  # 激活
    path('login', views.LoginView.as_view(), name='login'),  # 登录
    path('logout', views.LogoutView.as_view(), name='logout'),  #

    # path('', login_required(views.UserInfoView.as_view()), name='user'),
    # path('order', login_required(views.UserOrderView.as_view()), name='order'),
    # path('address', login_required(views.AddressView.as_view()), name='address'),

    path('', views.UserInfoView.as_view(), name='user'),
    # path('order', views.UserOrderView.as_view(), name='order'),
    re_path(r'^order/(?P<page>\d+)$', views.UserOrderView.as_view(), name='order'),  # 用户中心--订单页
    path('address', views.AddressView.as_view(), name='address'),


]